package com.linkhub.oms.admin.common.enums;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.linkhub.oms.common.enums.IEnumConvert;
import com.linkhub.oms.entity.ProductStockEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: StockSortFieldEnum
 * @Author: echo
 * @Date: 2024/4/26 13:58
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
public enum StockSortFieldEnum implements IEnumConvert<String> {
    PHYSICAL_STOCK(ProductStockEntity.Fields.physicalStock, ProductStockEntity::getPhysicalStock),
    PREEMPTION_STOCK(ProductStockEntity.Fields.preemptionStock, ProductStockEntity::getPreemptionStock),
    FROZEN_STOCK(ProductStockEntity.Fields.frozenStock, ProductStockEntity::getFrozenStock),
    PASSAGE_STOCK(ProductStockEntity.Fields.passageStock, ProductStockEntity::getPassageStock),

    ;
    private final String field;
    private final SFunction<ProductStockEntity, ?> column;

    @Override
    public String getCode() {
        return this.getField();
    }
}
